#ifndef __COMUNICATION_H__
#define __COMUNICATION_H__

#define ERRORSOCKET -1
#define ERRORHOST -2
#define ERRORSENDTCP -3
#define ERRORRCVTCP -4
#define ERRORCONNECT -5
#define ERRORACCEPT -6
#define ERRORSENDUDP -7
#define ERRORRCVUDP -8

int set_timeout_udp(int sec);

int set_timeout_tcp(int sec);

int bks_init_udp();

int bks_create_tcp();

int bks_init_server_socket(int port);

int bks_send_tcp(char pdu[]);

int bks_rcv_tcp(char pdu[]);

int bks_send_client_udp(char pdu[], char* name, int port);

int bks_send_server_udp(char pdu[]);

int bks_rcv_udp(char pdu[]);

int bks_accept();

int bks_connect(int sock, char* name, int port);

void bks_disconnect_tcp();

void bks_disconnect_udp();

void bks_close();

#endif

